package com.luckdraw.service;

import java.util.List;

import org.nutz.lang.util.NutMap;

import com.luckdraw.domain.CommissionLog;
import com.luckdraw.domain.ActivityLog;
import com.luckdraw.domain.Activity;
import com.luckdraw.domain.User;
import com.luckdraw.domain.WithdrawalLog;

public interface ActivityService {
	
	/**
	 * 获取已上线的活动列表
	 * @return
	 */
	public List<Activity> getLuckDrawSetList();
	
	/**
	 * 查询set信息
	 * @param setId
	 * @return
	 */
	public Activity getLuckDrawSet(int setId);
	
	/**
	 * 用户注册
	 * @param weixinOpenId	微信openId
	 * @param recommendUserId	推荐人用户ID
	 */
	public boolean register(String weixinOpenId,String recommendUserId);
	
	/**
	 * 获取用户信息
	 * @param weixinOpenId
	 * @return
	 */
	public User getUser(String weixinOpenId);
	
	/**
	 * 查询参与记录
	 * @param weixinOpenId
	 * @return
	 */
	public List<ActivityLog> getLuckDrawLogList(String weixinOpenId);
	
	/**
	 * 创建红包订单
	 * @param weixinOpenId
	 * @param setId
	 * @return
	 */
	public String createOrder(String weixinOpenId,int setId);
	
	/**
	 * 完成支付订单
	 * @param orderId
	 * @param openId
	 * @param transactionId
	 */
	public void finishedOrder(String orderId,String openId,String transactionId);
	
	/**
	 * 查询佣金获取记录
	 * @param weixinOpenId
	 * @return
	 */
	public List<CommissionLog> getCommissionLogs(String weixinOpenId) ;
	
	/**
	 * 提现
	 * @param weixinOpenId
	 * @return 
	 */
	public boolean withdrawals(String weixinOpenId,String mch_id,String wxappid);
	

	
	/**
	 * 添加账号余额
	 * @param userId
	 * @param amount
	 * @return
	 */
	public boolean addUserAmount(String userId,int amount);
	
	/**
	 * 减少账号余额
	 * @param userId
	 * @param amount
	 * @return
	 */
	public boolean minusUserAmount(String userId,int amount);

	/**
	 * @param openid
	 * @param momney 单位分
	 * @param mch_id
	 * @param wxappid
	 * @param apiKey
	 * @return
	 */
	public NutMap sendPay(String openid, int momney, String mch_id, String wxappid,String apiKey) throws Exception;

	public int countwithdrawalTimes(String userId);
    
	/**
	 * 是否关注公众号
	 * @return
	 */
	public Object isConcern(String weixinOpenId);
	
	/**
	 * 查询提现数据库日志记录
	 * @param id 商户订单id
	 * @param openId 用户openId
	 */
    public List<WithdrawalLog> getWithdrawalLogs(String id,String openId);
}
